<div class="almacenes view cont6">

<fieldset class="ui-widget-content ui-corner-all" style="width:97%;">
    <legend class="ui-widget-header ui-corner-all ui-state-default">Datos de Almac&eacute;n</legend>
    <div class="grid07b">Codigo</div>
    <div class="grid1">
        <?php echo $almacene['Almacene']['codigo']; ?>
    </div>
    <div class="grid03b">Area</div>
    <div class="grid07">
        <?php echo $almacene['Almacene']['area']; ?>m&sup2;
    </div>
    <div class="grid07b">Centro Dist.</div>
    <div class="grid2">
        <?php echo $almacene['CentroDist']['descripcion']; ?>
    </div>
    <div class="clear"></div>

    <div class="grid07b">Descripcion</div>
    <div class="grid2">
        <?php echo $almacene['Almacene']['descripcion']; ?>
    </div>
    <div class="grid07b">Direccion</div>
    <div class="grid2">
        <?php echo $almacene['Almacene']['direccion']?$almacene['Almacene']['direccion']:$almacene['CentroDist']['direccion']; ?>
    </div>
    <div class="clear"></div><br/>


    <fieldset class="ui-widget-content ui-corner-all" style="width:99%;">
        <legend class="ui-widget-header ui-corner-all ui-state-default">Usuarios Autorizados</legend>
    <div>
    <?php echo $form->create('AlmacenesUsuario',array('url'=>array('controller'=>'Almacenes','action'=>'view',$almacene['Almacene']['id'])) );?>
        <?php echo $form->input('usuario_id',array('div'=>false,'label'=>'Usuario'));?>
        <?php echo $form->hidden('almacen_id',array('value'=>$almacene['Almacene']['id']));?>
        <?php echo $form->submit('Adicionar',array('class'=>'btnnew','div'=>false));?>
    <?php echo $form->end();?><p/>
    </div>
    <div>
    <?php
    echo $getList->getList(array(
        'Usuario',array(
            'form'=>array('action'=>'view/'.$almacene['Almacene']['id'],'type'=>'post','id'=>'AlmacenesUsuarioForm'),
            'table'=>array('class'=>'celda','border'=>'0'),
            'config'=>array(
                '[AlmacenesUsuario][id]'=>array('type'=>'hidden','key'=>true ),
                '[id]'=>array('type'=>'checkbox','title'=>'','width'=>20),
                '[Tercero][razon_social]'=>array('type'=>'fields','title'=>'Nombre completo'),
                '[Grupo][descripcion]'=>array('type'=>'fields','title'=>'Grupo'),
                '[Area][descripcion]'=>array('type'=>'fields','title'=>'Area'),
                '[Tercero][direccion]'=>array('type'=>'fields','title'=>'Direccion'),
            ),
            'data'	=>$almacene['Usuario'],
            'adition'=>array('find'=>false,'paginator'=>false),
            'button'=>array(
                'default'=>false,
                'Eliminar'=>array('div'=>false,'class'=>'btnerase','name'=>'eliminar')
            )
        )
    ));?>
    </div>
    </fieldset>
    </fieldset>
</div>
<div class="actionsdown">
    <p>
        <?php echo $html->link(__('Volver', true), array('action' => 'index'), array('class'=>'lnkbutton btnback')); ?> 
        <?php echo $html->link(__('Nuevo', true), array('action' => 'add'), array('class'=>'lnkbutton btnnew')); ?> 	
        <?php echo $html->link(__('Editar', true), array('action' => 'edit', $almacene['Almacene']['id']), array('class'=>'lnkbutton btnedit')); ?> 
	<?php echo $html->link(__('Borrar', true), array('action' => 'delete', $almacene['Almacene']['id']), array('class'=>'lnkbutton btnerase'), sprintf(__('Are you sure you want to delete # %s?', true), $almacene['Almacene']['id'])); ?>
    </p>
</div><br/>
<script type="text/javascript">
    $(function(){
        $('#AlmacenesUsuarioForm .btnerase').unbind('click');
        var a = $('div.actionsdown');
        a.clone().prependTo(a.parent())
    });
</script>
<style type="text/css">
    fieldset fieldset div{
        padding:0;
        margin:0;
    }
    form, div.actions{
        margin:0 0 0 0;        
    }
</style>